import React, {Component} from 'react';
import {Popup, Tab,Button,Group,Field ,NumberPicker,SelectField } from 'saltui';


/**
 *  <EditStatus room  options  buttonName >
 */
export default class EditStatus extends React.Component {
  constructor(props) {

    super(props);
    this.state = {
      prices :[]
    };
    this.state.room = this.props.room
   // this.state.submitClick = this.props.submitClick
   // this.state.cancelClick  = this.props.cancelClick;
    this.state.options = this.props.options;
    this.state.buttonName = this.props.buttonName;

  }

  onChange = (id,value) =>{
    console.info(value);
  }




  render() {
    let that = this;
    return <Button type="secondary"  size="small" onClick={() => {
      Popup.show(<div className="demo-popup-container">   <Group.List >
          {
            this.state.room.map((room,index) =>(
              <SelectField
                label={room.name}
                options={this.state.options}
                onSelect={this.onChange}
                value={{ value: room.type, text: room.typeName }}
                placeholder="请输入"
              />
            ))
          }
        </Group.List>
        <div className="demo-line">
          <Button type="secondary"  size="small"  >提交</Button>
          <Button type="secondary"  size="small"  >取消</Button>
        </div></div>, {
        animationType: 'slide-down',
      });
    }} >{this.state.buttonName}</Button>
  }
}
